package aden.SifWar.EvtLog;

import aden.SifWar.SifWarPlayerMgr;


public class SifWarEvtLogMgr
{
	public SifWarEvtLogMgr(SifWarPlayerMgr inPlayerMgr)
	{
		mPlayerMgr = inPlayerMgr;
		mTurnLastLog = null;
		mTurnFirstLog = null;
		mOriginLog = null;
	}
		
	public boolean Add(SifWarEvtLog inLog)
	{
		if (mOriginLog == null)
		{
			mTurnLastLog = inLog;
			mTurnFirstLog = inLog;
			mOriginLog = inLog;
		}
		else
		{
			if (mTurnFirstLog == null)
			{
				mTurnFirstLog = inLog;
			}
			mTurnLastLog.SetNext(inLog);
			mTurnLastLog = inLog;
		}
		return true;
	}

	public boolean Finalize()
	{
		// flush vers les slaves
		// A FAIRE
		
		// archivage
		mTurnFirstLog = null;
		
		return true;
	}
	
	public boolean RemoveOldLogs(int inTurnId)
	{
		return true;
	}
	public SifWarPlayerMgr GetPlayerMgr() {return mPlayerMgr;}
	
	private SifWarPlayerMgr mPlayerMgr;
	private SifWarEvtLog mOriginLog;
	private SifWarEvtLog mTurnFirstLog;
	private SifWarEvtLog mTurnLastLog;
}